#ifndef __THREADPOOL__
#define __THREADPOOL__
#include <func.h>
#include "taskQueue.h"

typedef struct threadPool_s{
    pthread_t *tidArr;
    int threadNum;
    char userName[50];
    taskQueue_t taskQueue;
    pthread_mutex_t mutex;
    pthread_cond_t cond;
    int isThreadPoolRunning;
} threadPool_t;
int threadPoolInit(threadPool_t *pThreadPool,int workerNum);

void *uploadFunc(void *parg);
void *threadFunc(void *parg);
int makeWorker(threadPool_t *pThreadPool);
void unlock(void *parg);
int handleEvent(task_t *task);
#endif